UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8uvvcKP7+SXSLaKCnNI3HFt2unsAsbne70yTobY/8uk=' 
WHERE 
  key_id = '301be3a286c194bd9e3d8a96a9574b6eb307e71269ffe4404325662c6ed931da' 
  AND (
    token = '8uvvcKP7+SXSLaKCnNI3HFt2unsAsbne70yTobY/8uk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038