UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'k+lQEKhjg4CqOgNzwHnDU8lmKST5kW8DQMiOUtgZRX0='
WHERE
key_id = '6b6899f7221e6f2531132457907a29ac7107d6c90ddda78f11315467ed6a5dd2'
AND (
token = 'k+lQEKhjg4CqOgNzwHnDU8lmKST5kW8DQMiOUtgZRX0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)