UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+VgUz9OpcsuBGDxH9cAJayyvnuDmwNCd6C3TlOej6n4=' 
WHERE 
  key_id = '913aeb222d88f1630a2e9a616dade85757a1c3804266b2be5020e93c04c5932a' 
  AND (
    token = '+VgUz9OpcsuBGDxH9cAJayyvnuDmwNCd6C3TlOej6n4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019