UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GsxbvS9/HsokLYGIGks3wnEBhJfRV7inTDRH9WsunwQ='
WHERE
key_id = 'f051934029d3db33679e108ac40cd0c647bf559e4705114d9468da9938ac8c97'
AND (
token = 'GsxbvS9/HsokLYGIGks3wnEBhJfRV7inTDRH9WsunwQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)