UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dq5mJ8YtjLmah6PEkZ9PanWlxOSmlrIpwnR5Ybm+mkg=' 
WHERE 
  key_id = 'a8934f662dbb7ebdb0df25921b7400d7e4eaae85586aa3ccf29237e7cb8bca49' 
  AND (
    token = 'dq5mJ8YtjLmah6PEkZ9PanWlxOSmlrIpwnR5Ybm+mkg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034