UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xtCbsUFWvC/b3cGBEJit1a2RcjCZ4OTwipRMswE4UrQ='
WHERE
key_id = 'd38ae25650621f97e9e5a214f801053f0b82d8d900eb21e8cacd028d77da2f6f'
AND (
token = 'xtCbsUFWvC/b3cGBEJit1a2RcjCZ4OTwipRMswE4UrQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)