UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dFEhWKJNiJ5sSbOvBWJHmlBeAM+G++5zRHaNsMNNQTw='
WHERE
key_id = 'be6abed63027796e7c3a9e28900bac8e7abfbd28970e6afb0c6ccb3e9c7cc9b1'
AND (
token = 'dFEhWKJNiJ5sSbOvBWJHmlBeAM+G++5zRHaNsMNNQTw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)