UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SOvG2YPcC+6zURKHk5XvfaUtLyKtDUneJzFc7VHqQ9k=' 
WHERE 
  key_id = '7d7a5c811401aef4c7961c5120515ffc1237b3b02183e03361ef372afea18d33' 
  AND (
    token = 'SOvG2YPcC+6zURKHk5XvfaUtLyKtDUneJzFc7VHqQ9k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041