UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kahfE1wsZlTBOkcTf4S9HxTIAv+YISQXANfKiSuBytY=' 
WHERE 
  key_id = 'f477136232a81372b832551f1b957e1cc85eb921662918b3c33b49c2742fdba3' 
  AND (
    token = 'kahfE1wsZlTBOkcTf4S9HxTIAv+YISQXANfKiSuBytY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041