UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6Io4yq9NEstsUmRAovL/1EOTp8jESvWEZUGx//pwK6U='
WHERE
key_id = 'ededf54307959b6bed29f89f2dba8dd7401fc9dfac47530f985cc38d5da6f94e'
AND (
token = '6Io4yq9NEstsUmRAovL/1EOTp8jESvWEZUGx//pwK6U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)