UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'M9LjxZR9xVtJEUy8sKZ/AEVyyzb1VVDeTgIV2oNHSaY=' 
WHERE 
  key_id = '27031727cf948598292ad6401d262dfd8978954895afd01f82897a9c0ebca962' 
  AND (
    token = 'M9LjxZR9xVtJEUy8sKZ/AEVyyzb1VVDeTgIV2oNHSaY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017