UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oV2rc3uVVGxeKHaetqIBKGr0d/KGpS97ZaNGbsPmNXU=' 
WHERE 
  key_id = '34360cc82e1d261ee6ce043ccfd68582a5e932adfc632ae2003b223b35b05fe2' 
  AND (
    token = 'oV2rc3uVVGxeKHaetqIBKGr0d/KGpS97ZaNGbsPmNXU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041