UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0lF+zIbiuDF8fp3nwkdF1MIhgJpy4XsmFTJCrIOkW0c='
WHERE
key_id = 'c08c4529c1a6d47d884d4567e6c2f2ddd84ca094ff87c81c5656c48ff1b6c191'
AND (
token = '0lF+zIbiuDF8fp3nwkdF1MIhgJpy4XsmFTJCrIOkW0c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)