UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'K+21YRPjadh45YWeyA6hTuiGzOP3YL26l4qT/cgvGYo='
WHERE
key_id = 'b13e75d9da0179b9d696e7a89dc7f8a248a86b4eed9876b874aa7010e1f670a6'
AND (
token = 'K+21YRPjadh45YWeyA6hTuiGzOP3YL26l4qT/cgvGYo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)