UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4YJsMNcTlP8Y3TXmBxGi2phWGX+6EIw7jVLjBwdjkH4='
WHERE
key_id = 'dadd555c544194e9b9a57e7833c34b858f3b24c83908caca097f25dc587e936b'
AND (
token = '4YJsMNcTlP8Y3TXmBxGi2phWGX+6EIw7jVLjBwdjkH4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)