UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1WJ30a6RWpCqVQTgksuTvoIqXyyIL6O2IxzELdEoK6M='
WHERE
key_id = '528f3c12ae9eb124bac00b629b97c46dbc009693145948b15ac90824fb9266f5'
AND (
token = '1WJ30a6RWpCqVQTgksuTvoIqXyyIL6O2IxzELdEoK6M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)