UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Vo2OfG7YpvMacCyobZ/TsKEeCyijUHOxyBovTW7yaJQ=' 
WHERE 
  key_id = '8fb1174ad5831f2fba9b835097bdf81df318e25fa8a6d9c3330a45bc5a69a801' 
  AND (
    token = 'Vo2OfG7YpvMacCyobZ/TsKEeCyijUHOxyBovTW7yaJQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046