UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TRzB4dYbGH+MekowI3LX2VlxqkQtp4L/xfrh4/QyBT8='
WHERE
key_id = 'fac52bf3536a53f13b86d568f96092990e48cd2feac928a21da3074ccc4239f5'
AND (
token = 'TRzB4dYbGH+MekowI3LX2VlxqkQtp4L/xfrh4/QyBT8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)