UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NUruWDn8wHnSxfCQNl7O3qJAMyo5Aw5FYMHM+TbZTfI=' 
WHERE 
  key_id = 'b9730ca6c96a75dc7d027e02424208a0c85342f779b9ee190b83a35a86dbaf8e' 
  AND (
    token = 'NUruWDn8wHnSxfCQNl7O3qJAMyo5Aw5FYMHM+TbZTfI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016