UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'I8+3lpdS/q290zmmWgSqK6CRfhr1q7NW5/o/RLvCm7M='
WHERE
key_id = '6f5d6d28e43482ceee2d485415398a69f780a2b995381ab9baa570b7410776a5'
AND (
token = 'I8+3lpdS/q290zmmWgSqK6CRfhr1q7NW5/o/RLvCm7M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)