UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LTL7bdt0Tgs5arLgPMgCD2b2U+DpXgOGg7U97uQFYRQ='
WHERE
key_id = '45d90e6913395987065d39460949c6f14c38c16d7c26bcc4ad010382f33637e0'
AND (
token = 'LTL7bdt0Tgs5arLgPMgCD2b2U+DpXgOGg7U97uQFYRQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)