UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bzZO/UhrI8MWc2SJbe5vH/n16zJ+XRM/QFKVklLlPzk='
WHERE
key_id = '1c0b1732a8f6c6336dc57fe11aacf64a6ebe81bb551968149180b02a32fa75ef'
AND (
token = 'bzZO/UhrI8MWc2SJbe5vH/n16zJ+XRM/QFKVklLlPzk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)