UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2DI72z2ceVtoLOZEyP4eOdrFStBD7V/GguB1KXb5Xzw='
WHERE
key_id = 'ebccd47fc23c75ac306bc7c6e8b13011633f650f0beb22da2b8a9b84f27791ac'
AND (
token = '2DI72z2ceVtoLOZEyP4eOdrFStBD7V/GguB1KXb5Xzw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)