UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Fil121HuzwQ+ZMt/suWTAakyfwAv//BdrHYuNrm1kDY=' 
WHERE 
  key_id = '72ea6a8721bddf66d75fe0d1ff56650cc24d443d5dd595235ecaf1bd029c39cf' 
  AND (
    token = 'Fil121HuzwQ+ZMt/suWTAakyfwAv//BdrHYuNrm1kDY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00060