UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RKshrJI7rIBzVPZVqyBCNPQjj6+r5lgwgplThU31si0='
WHERE
key_id = '51b1bc1ff43b3d083914bbc58637a2f0d5fcddde8e0e718636b45fca4918f128'
AND (
token = 'RKshrJI7rIBzVPZVqyBCNPQjj6+r5lgwgplThU31si0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)