UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UtpoUCTtIf36neH5/alImFyp6fJnTwC8B4XDxKAKM3s=' 
WHERE 
  key_id = '4c351256d45d572111cc28d73f13a1bc5015bca3e4fc1fe3b452c2db978bfbb9' 
  AND (
    token = 'UtpoUCTtIf36neH5/alImFyp6fJnTwC8B4XDxKAKM3s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034