UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4o8VmZ7R/R2oehRO9S4ZWf1iQSBYaYJzqh9fCQsDMbA=' 
WHERE 
  key_id = '93ac3d54db95752ce02c0cb5aa07e7250c671e3e6fcfecd42c0996941ff04092' 
  AND (
    token = '4o8VmZ7R/R2oehRO9S4ZWf1iQSBYaYJzqh9fCQsDMbA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039