UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gwmc/2gYPynpZcpgsSn4PMtUc9pNOh91SwWnZDtXqiY='
WHERE
key_id = 'a2855533d0288b78446ce60ddaa12520894f89e03e373f85bd84fd3de39306cb'
AND (
token = 'gwmc/2gYPynpZcpgsSn4PMtUc9pNOh91SwWnZDtXqiY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)