UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fLytT9zAj/HkYgEBnYAEbv8VyBiLPjGBU2kBGNfsSwg='
WHERE
key_id = '15638f1c792cebe5909be24fd880c4268aa65ad288eb49e1228ffec159e9b91c'
AND (
token = 'fLytT9zAj/HkYgEBnYAEbv8VyBiLPjGBU2kBGNfsSwg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)