UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Xf4LAtX6bqeloqH8WtTstBqTMBfl5wD/1qVeAKo0gVI=' 
WHERE 
  key_id = '459a964ecf35bd7e1aece563de87c5cfd3cd5b1bee73a427cf0a925d77cf9151' 
  AND (
    token = 'Xf4LAtX6bqeloqH8WtTstBqTMBfl5wD/1qVeAKo0gVI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039