UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gO06mzoMQFMgoXF2BvmiftSovYkmdEdBHBWaxCsHJHw='
WHERE
key_id = '3fe080a54bc64506370bd9065b8fde01aa9ef2024f96813a1538a162472e764d'
AND (
token = 'gO06mzoMQFMgoXF2BvmiftSovYkmdEdBHBWaxCsHJHw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)