UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hRgiEIFzISYUVrOfkTzhwZ5XvGA5JJEpO+Tpy8IsuNs='
WHERE
key_id = '38ff52f76f24e65845dc14c21c0568f7c6cfaaed8e3624c6664f5ff0e7dd04e3'
AND (
token = 'hRgiEIFzISYUVrOfkTzhwZ5XvGA5JJEpO+Tpy8IsuNs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)