UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'u23qvVZIAWjLxEU6fG4LwCTsTGL7LsXPzR/nwfS9a9s='
WHERE
key_id = 'eae4891a0c6f2dc4b4a69fd61f06db5c5c1e0a98194da5833f30ed614cb64f40'
AND (
token = 'u23qvVZIAWjLxEU6fG4LwCTsTGL7LsXPzR/nwfS9a9s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)