UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DIu0yeE1D9uXe8RBG4rpTqNYD3jk1vlVOfqvZf59WCk=' 
WHERE 
  key_id = 'b2eb26720610b5ee3dfef088e26b2ac1a03a5b078117ec3e4acb56f46f5550c4' 
  AND (
    token = 'DIu0yeE1D9uXe8RBG4rpTqNYD3jk1vlVOfqvZf59WCk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029