UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yEs+sKOaD9vkNPvggXviVmh73+RSvIFjohqitrMt22I='
WHERE
key_id = 'a033b0cd07981637350ae3635bfa3374909d408dd174cda15a81310309988bc8'
AND (
token = 'yEs+sKOaD9vkNPvggXviVmh73+RSvIFjohqitrMt22I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)